
#include "CommandImpl.h"

using namespace npCommand;


CommandImpl::CommandImpl() : Command() // class inheritance
{
    //To initialize data member;
}

CommandImpl::~CommandImpl()
{
    //To delete dynamic data member
}

CommandImpl::CommandImpl(const CommandImpl& cpy): Command(cpy) // class inheritance
{
    //To copy data member
}

CommandImpl& CommandImpl::operator=(const CommandImpl& asn)
{
    if (this == &asn)
    {
        return *this;
    }
    else
    {
        //To invoke base class operator=
        Command::operator=(asn);
        //To assign data member, note to delete dynamic member if exists.
        
        return *this;
    }
}

CommandImpl* CommandImpl::clone() const
{
    //return new
    return new CommandImpl(*this);
}

//other constructors

//public methods
void CommandImpl::setReceiver(Receiver* receiver) throw()
{
    this->receiver = receiver;
}

void CommandImpl::execute() throw()
{
    if (this->receiver)
    {
        this->receiver->action();
    }
    
}

//protected methods

//private methods
